package book;

public class BookList {
    public Book[] books=new Book[10];
    public int usedSize;//用来存储当前书架中书的个数
    //通过构造方法 初始化的时候 给书架这个数组里面预存了三本书 usedSize=3，当它等于数组长度的时候就说明书架被填满了。
    public BookList(){
        books[0]=new Book("三国演义","罗贯中",89,"文学");
        books[1]=new Book("老人与海","海明威",34,"文学");
        books[2]=new Book("诗经","未知",85,"诗词");
        this.usedSize=3;
    }
    public Book getPos(int pos){
        return books[pos];
    }
    public void setBooks(Book book,int pos){

        books[pos]=book;
    }public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }





}
